SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



--Vista con la relación campo-tabla
CREATE VIEW [dbo].[wav_campos_tabla]
AS 

SELECT syscolumns.name as nm_campo, sysobjects.name as nm_tabla, 
	wad_tablas.de_tabla, syscolumns.length as ca_ancho,
	syscolumns.prec as ca_decimales
FROM syscolumns 
	JOIN sysobjects ON syscolumns.id = sysobjects.id
	LEFT JOIN wad_tablas ON sysobjects.name = wad_tablas.nm_tabla
WHERE SUBSTRING(syscolumns.name,3,1)='_'

GO
